package light.head.dao.site;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import light.head.constant.Parm;
import light.head.enm.RESULT;
import light.head.framework.base.BaseDAO;
import light.head.framework.entity.PageBean;
import light.head.model.RecruitJoin;
import org.springframework.stereotype.Service;

@Service
public class RecruitJoinDAO extends BaseDAO<RecruitJoin, Serializable>{
	public RESULT findByMap(Map<String, String> map, PageBean pageBean) {
		StringBuffer hql = new StringBuffer("FROM RecruitJoin rj WHERE 1 = 1");
		List<Object> list = null;
		if (map != null) {
			list = new ArrayList<Object>();
			String rc = map.get(Parm.RC);
			if (rc != "" && isNotNull(rc)) {
				hql.append(" AND rj.rc = ? ");
				list.add(Integer.parseInt(rc));
			}
		}
		hql.append(" ORDER BY rj.code");

		return findToPageBean(hql.toString(), pageBean, list);
	}
}
